Serialization is a process of translating data structures or object state into a format that can be stored, for example, in a file or memory buffer, or transmitted across a network connection link and reconstructed later in the same or another computer environment. A software object (“object”) has state and behavior. The objects correspond to things found in the real world. So for example, a graphics program will have objects such as a circle, a square, and a menu. An online shopping system will have objects such as a shopping cart, a customer, and a product. When an object is serialized, the state of the object, that is, the attributes and attribute values of the object, is written to a data stream as a serialized object in a particular format. The serialized object can be stored in the persistent storage device or transmitted to another computing device. Some example formats of a serialized object include binary format, human-readable formats such as XML, JavaScript Object Notation (JSON) etc. Some other properties of the object such as a name of the class to which the object belongs, a name of the class of non-primitive attributes are also written to the data stream. When the object is serialized into the binary format, the class names, the attributes, the attribute values are written into the serialized object as a stream of bytes in a particular sequence.
The content of the byte stream, the sequence in which the data is written into the byte stream depends on a serialization scheme used by the application that generated the serialized object. Different serialization schemes have different properties and purposes. For example, some serialization schemes are intended to be faster in serializing data, some are intended to be faster in deserializing, some are intended to produce smaller size serialized objects, etc. Some serialization schemes include a complete class name for every non-primitive attribute of the object even though the class name has already appeared once for a previous attribute in the serialized object, some use a short code to identify the repeating class names, etc.
An application can reconstruct the object by deserializing the serialized object. Deserializing the serialized object includes reading the byte stream from the serialized object and constructing the data of the object corresponding to the attributes and the attribute values represented by the sequence of bytes in the byte stream. The application can deserialize the serialized object if the application knows the serialization scheme used in the serialization, which may not a problem for an application that generated the serialized object. However, if another application intends to reconstruct the object, it may not be possible to reconstruct the object since the other application does not know the serialization scheme used for generating the serialized object.